package org.saltlux.study.jackrabbit;

import javax.jcr.Repository;
import javax.jcr.Session;

import org.junit.Assert;
import org.junit.Test;

public class FirstHopTester {
	@Test
	public void testAnonymous() throws Exception {
		Repository repository = RepositoryManager.getInstance().getRepository();
		Session session = repository.login();
		try {
			String user = session.getUserID();
			String name = repository.getDescriptor(Repository.REP_NAME_DESC);
			Assert.assertEquals("anonymous", user);
			Assert.assertEquals("Jackrabbit", name);
		} finally {
			session.logout();
		}
	}
}
